<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="../member/js/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <script type="text/javascript" src="../member/js/vue.min.js" ></script>

    <script>
        $.post(
            "../worker/getWorkerSession",
            function (getWorker) {
                new Vue({
                    el:"#workerSelf",
                    data:{
                        workerSelf:getWorker
                    },
                    methods:{
                        updateWorker:function () {
                            var that=this;
                            var w_num=$("#w_num").val();
                            var w_name=$("#w_name").val();
                            var w_sex=$("#w_sex").val();
                            var w_idcard=$("#w_idcard").val();
                            var w_password=$("#w_password").val();
                            var w_email=$("#w_email").val();
                            var w_phone=$("#w_phone").val();
                            var w_strongpoint=$("#w_strongpoint").val();
                            $.post(
                                "../worker/updateWorkerSelf",
                                "w_id="+getWorker.w_id+
                                "&w_num="+w_num+
                                "&w_password="+w_password+
                                "&w_name="+w_name+
                                "&w_sex="+w_sex+
                                "&w_phone="+w_phone+
                                "&w_email="+w_email+
                                "&w_idcard="+w_idcard+
                                "&w_strongpoint="+w_strongpoint,
                                function (result) {
                                    if(result.msgs=="true"){
                                        alert("修改成功！");
                                        // 获得frame索引
                                        var index = parent.layer.getFrameIndex(window.name);
                                        //关闭当前frame
                                        parent.layer.close(index);
                                    }else {
                                        alert("修改失败！");
                                    }
                                }
                            );
                        }
                    }
                })
            }
        );
    </script>
</head>

<body>
<div id="workerSelf">
  <div class="x-body">
        <div class="layui-form-item">
            <label for="L_email" class="layui-form-label">
                姓名:
            </label>
            <div class="layui-input-inline">
                <span type="text" id="L_email" name="email" required="" lay-verify="email"
                      autocomplete="off" class="layui-input">{{workerSelf.w_name}}</span>
            </div>
        </div>
        <div class="layui-form-item">
          <label for="w_num" class="layui-form-label">
              工号:
          </label>
          <div class="layui-input-inline">
                <span type="text" id="w_num" name="email" required="" lay-verify="email"
                      autocomplete="off" class="layui-input">{{workerSelf.w_num}}</span>
          </div>
        </div>
        <div class="layui-form-item">
          <label for="w_sex" class="layui-form-label">
              性别:
          </label>
          <div class="layui-input-inline">
                <span type="text" id="w_sex" name="email" required="" lay-verify="email"
                      autocomplete="off" class="layui-input">{{workerSelf.w_sex}}</span>
          </div>
        </div>
      <div class="layui-form-item">
          <label for="w_idcard" class="layui-form-label">
              身份证号:
          </label>
          <div class="layui-input-inline">
                <span type="text" id="w_idcard" name="email" required="" lay-verify="email"
                      autocomplete="off" class="layui-input">{{workerSelf.w_idcard}}</span>
          </div>
      </div>
        <div class="layui-form-item">
            <label for="w_password" class="layui-form-label">
                <span class="x-red">*</span>重置密码：
            </label>
            <div class="layui-input-inline">
                <input type="text" id="w_password" required="" lay-verify="nikename"
                autocomplete="off" class="layui-input" :value="workerSelf.w_password">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="w_phone" class="layui-form-label">
                <span class="x-red">*</span>手机号：
            </label>
            <div class="layui-input-inline">
                <input type="text" id="w_phone" required="" lay-verify="repass"
                autocomplete="off" class="layui-input" :value="workerSelf.w_phone">
            </div>
        </div>
      <div class="layui-form-item">
          <label for="w_email" class="layui-form-label">
              <span class="x-red">*</span>邮箱：
          </label>
          <div class="layui-input-inline">
              <input type="text" id="w_email" required="" lay-verify="repass"
                     autocomplete="off" class="layui-input" :value="workerSelf.w_email">
          </div>
      </div>
      <div class="layui-form-item">
          <label for="w_strongpoint" class="layui-form-label">
              <span class="x-red">*</span>擅长领域：
          </label>
          <div class="layui-input-inline">
              <input type="text" id="w_strongpoint" required="" lay-verify="repass"
                     autocomplete="off" class="layui-input" :value="workerSelf.w_strongpoint">
          </div>
      </div>
        <div class="layui-form-item">
            <label for="w_num" class="layui-form-label">
            </label>
            <button  class="layui-btn" lay-filter="add" lay-submit="" @click="updateWorker()">
                修改
            </button>
        </div>

  </div>
</div>
  <script>var _hmt = _hmt || []; (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();</script>
</body>

</html>